'\"macro stdmacro
.TH TELNET-PROBE 1 "PCP" "Performance Co-Pilot"
.SH NAME
\f3telnet-probe\f1 \- lightweight telnet-like port probe
.SH SYNOPSIS
\f3$PCP_BINADM_DIR/telnet-probe\f1
[\f3\-cv?\f1]
\f2host\f1 \f2port\f1
.SH DESCRIPTION
.B telnet-probe
allows the
.BR pmdashping (1)
daemons to establish connections to arbitrary local and remote
service-providing daemons so that response time and service
availability information can be obtained.
.PP
The required
.I host
and
.I port
number arguments have the same meaning as their
.BR telnet (1)
equivalents.
.PP
The
.B \-c
option causes
.B telnet-probe
to perform a
.BR connect (2)
only.
This skips the
.BR read (2)
and
.BR write (2)
exercise that would otherwise be done after connecting (see below).
.PP
Once the telnet connection has been established,
.B telnet-probe
reads from
.I stdin
until end-of-file, and writes all the input data to the
telnet connection.
Next,
.B telnet-probe
will read from the telnet connection until end-of-file,
discarding whatever data it receives.
Then
.B telnet-probe
exits.
.PP
To operate successfully, the input passed via
.B telnet-probe
to the remote service must be sufficient to cause the remote service to
close the connection when the last line of input has been processed,
e.g. ending with ``quit'' when probing SMTP on port 25.
.PP
By default
.B telnet-probe
will not produce any output, unless there is an error in which case
a diagnostic message can be displayed (in verbose mode only) and the
exit status will be non-zero indicating a failure.
.SH OPTIONS
The available command line options are:
.TP 5
\fB\-c\fR
Connect only, do not read or write.
.TP
\fB\-v\fR
Enable verbose mode.
.TP
\fB\-?\fR
Display usage message and exit.
.SH DIAGNOSTICS
If
.B telnet-probe
succeeds, then 0 will be returned.
If the attempt to establish a connection fails or is terminated, then
a non-zero exit status is returned.
.SH PCP ENVIRONMENT
Environment variables with the prefix \fBPCP_\fP are used to parameterize
the file and directory names used by PCP.
On each installation, the
file \fI/etc/pcp.conf\fP contains the local values for these variables.
The \fB$PCP_CONF\fP variable may be used to specify an alternative
configuration file, as described in \fBpcp.conf\fP(5).
.SH SEE ALSO
.BR PCPIntro (1),
.BR pmdashping (1),
.BR pmie (1),
.BR telnet (1),
.BR connect (2),
.BR read (2)
and
.BR write (2).
